package com.zecan.blog.vo.user;

import com.zecan.blog.entity.Article;
import lombok.Data;

/**
 * 用户展示文章信息vo
 * @ClassName UserArticleVo
 * @Description
 * @date 2022/11/9 12:26
 * @Version 1.0
 */
@Data
public class UserArticleVo {

    Integer articleId;

    String articleTitle;

    String articleDescription;

    String articleImgUrl;

    String articleTag;

    String articleContent;

    String articleCreateTime;

    String articleClassify;


    public static UserArticleVo  buildUserArticle(Article article){
        UserArticleVo userArticleVo = new UserArticleVo();

        userArticleVo.articleId = article.getArticleId();
        userArticleVo.articleTitle = article.getArticleTitle();
        userArticleVo.articleClassify = article.getArticleClassify();
        userArticleVo.articleContent = article.getArticleContent();
        userArticleVo.articleImgUrl = article.getArticleImage();
        userArticleVo.articleTag = article.getArticleTag();
        userArticleVo.articleCreateTime = article.getArticleCreateTime();
        userArticleVo.articleDescription = article.getArticleDescription();

        return userArticleVo;
    }

}
